/** \file AudioWAV.h
    \author belot.nicolas
    Create a Wave File
*/

#ifndef AUDIOWAV_H
#define AUDIOWAV_H 1

#include "Audio.h"
#include <sndfile.h>
namespace libtrckr {
class AudioWAV : public Audio {
/** \class libtrckr::AudioWAV
    \brief output in a wav file.
*/
	public:
	AudioWAV( );
	AudioWAV(const AudioWAV&);
	~AudioWAV();
	/** get the number of channel */
	int channels() const;
	/**set the number of channels */
	void channels( int);
	/** get the birate */
	int bitrate() const;
	/** set the bitrate */
	void bitrate(int);

	/** Open the output */
	void open();
	/** output state of the Audio */
	audio_state_t state();
	/** Close the output */
	void close();

	/** Append data to the output
	*/
	int append(Buffer b);	

	void param(std::string, std::string);	
	void param(std::string, double);
	void param(std::string, int);

	private:
	SNDFILE * _handler;
	struct SF_INFO*	_sfinfo;
	audio_state_t _state;
	std::string filename;

};

}
#endif
